
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>管理员资料修改</title>

    <!-- Bootstrap core CSS -->
    <link href="__CSS__/bootstrap.min.css" rel="stylesheet">
    <link href="__CSS__/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="__MODES__/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="__CSS__/style.css" rel="stylesheet">
    <link href="__CSS__/style-responsive.css" rel="stylesheet" />
    <script  src="__PLUGINS__/jquery-1.9.1.min.js"></script>
    <script  src="__PLUGINS__/layer/layer.js"></script>
    <script  src="__PLUGINS__/common.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
    <script src="__JS__/html5shiv.js"></script>
    <script src="__JS__/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<section id="container" class="">

    {include file="Public/header" /}

    {include file="Public/sidebar" /}
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <!-- page start-->
            <div class="row">
               
                <aside class="profile-info col-lg-9">
                    <section class="panel">
                        <div class="bio-graph-heading">
                           <b>管理员资料修改</b>
                        </div>
                        <div class="panel-body bio-graph-info">
                            <h1> 基础资料</h1>
                            <form class="form-horizontal" role="form" name="save-form" id="add-member-form" action="">
								<input type="hidden" id="id" name="id" value="{$data['admin_id']}" />
                                <div class="form-group">
                                    <label  class="col-lg-2 control-label">登陆账号</label>
                                    <div class="col-lg-6">
                                        <input type="text" class="form-control" id="admin_name" name="admin_name"  value="{$data['admin_name']}" placeholder=" ">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label  class="col-lg-2 control-label">负责人姓名</label>
                                    <div class="col-lg-6">
                                        <input type="text" class="form-control" value="{$data['admin_user']}" name="admin_user" id="admin_user"  placeholder=" ">
                                    </div>
                                </div>
                               
                                <div class="form-group">
                                    <label  class="col-lg-2 control-label">管理权限</label>
                                    <div class="col-lg-6">
                                        <select class="form-control" name="member_agent" id="member_agent">
                                            <option value='0' {$data['admin_role']==0? 'selected' : ''}>超级管理员</option>
                                            {volist name="listclass" id="v"}
                                            <option value='{$v.id}' {$data['admin_role']==$v.id? 'selected' : ''}>{$v.title}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
           
                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button type="button" id="save-member" class="btn btn-success">修改</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </section>

                </aside>
            </div>

            <!-- page end-->
        </section>
    </section>
    <!--main content end-->
</section>

<!-- js placed at the end of the document so the pages load faster -->
<script src="__JS__/jquery.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.scrollTo.min.js"></script>
<script src="__JS__/jquery.nicescroll.js" type="text/javascript"></script>
<script src="__MODES__/assets/jquery-knob/js/jquery.knob.js"></script>
<!--custom switch-->
<script src="__JS__/bootstrap-switch.js"></script>
<!--common script for all pages-->
<script src="__JS__/common-scripts.js"></script>
<script>
    $("#save-member").click(function(){
        var add_url = "{Url('Admins/updeadmin')}";
        var admin_name = $("#admin_name").val();
        var admin_user   = $("#admin_user").val();
      
        
        if(admin_name == ''){
            errorTips("add-member",$("#admin_name"),"请输入管理账号！");
            return;
        }
        if(admin_user==''){
            errorTips("add-member",$("#admin_user"),"请输入负责人姓名！");
            return;
        }
        
        var data = $("form[name=save-form]").serialize();
        ajaxPost(add_url,$("#save-member"),data,function (r) {
            $("#login_btn").removeAttr('disabled');
            window.location.href = "{:Url('Admins/index')}";
           // location.reload();
        })
    });
</script>

</body>
</html>
